<?php
	$username=$_POST['username'];
	$userpass=$_POST['userpass'];
	//pdo预编译 创建对象
	$sql="select * from userstb where name=? and password=?";
	$mypdo=new PDO("mysql:host=localhost;port=3306;dbname=mysqli",'root','dx123');
	//预处理
	$pdostate=$mypdo->prepare($sql);
	//填入数据
	$pdostate->execute(array($username,$userpass));
	//取出结果
	$res=$pdostate->fetch();
	if(!empty($res))
	{
		//mysql_free_result($res);
		echo "true";
		//header("Location:ok.php");
	}
	else
	{
		//mysql_free_result($res);
		echo "false";
	}
?>